fn main() {
    {
        // This one is type [&str; 2].
        let array1 = ["One", "Two"];
        dbg!(&array1);
        // But this one is type [&str; 3]. Different type!
        let array2 = ["One", "Two", "Five"];
        dbg!(&array2);
    }

    println!();

    {
        let my_array = ["a"; 10];
        println!("{:?}", my_array);
    }

    println!();

    {
        let my_numbers = [0, 10, -20];
        println!("{}", my_numbers[1]);
    }

    println!();

    {
        // You can get a slice (a piece) of an array. First you need a &,
        // because the compiler doesn't know the size. Then you can use .. to
        // show the range.
        //
        // Remember that:
        //
        // - Index numbers start at 0 (not 1)
        // - Index ranges are exclusive (they do not include the last number)

        let array_of_ten = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];

        let three_to_five = &array_of_ten[2..5];
        let start_at_two = &array_of_ten[1..];
        let end_at_five = &array_of_ten[..5];
        let everything = &array_of_ten[..];

        println!(
            "Three to five: {:?}, start at two: {:?}, end at five: {:?}, everything: {:?}",
            three_to_five, start_at_two, end_at_five, everything
        );
    }
}
